package com.example.demo.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import com.example.demo.dto.MainTheaterDto;
import com.woniuxy.movice.entity.MainTheater;

public interface MainTheaterMapper {

	@Select("select * from main_theater as dd,combo where dd.tid = combo.tid and zstate=#{zstate}")
	List<MainTheaterDto> getAllTheater(String zstate);

	@Update("update main_theater set zstate='已通过',endtime=DATE_ADD(now(),INTERVAL #{tyear} year) where zid=#{zid}")
	int PassTheater(int zid, int tyear);
	
	@Update("update main_theater set zstate='已拒绝' where zid=#{zid}")
	int RefuseTheater(int zid);

	@Update("update main_theater set endtime=DATE_ADD(endtime,INTERVAL #{tyear} year) where zid=#{zid}")
	int addTime(int zid, int tyear);
	
}
